package com.yvon.service.demo.netty.server;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpRequestDecoder;
import io.netty.handler.codec.http.HttpResponseEncoder;

/**
 * @author yvon
 * @since 2023-06-05
 */
public class MyChannelInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel channel) throws Exception {
        channel.pipeline().addLast(new HttpResponseEncoder());
        channel.pipeline().addLast(new HttpRequestDecoder());
        channel.pipeline().addLast(new MyServerHandler());
    }
}
